<?php
/**
 * 赞助商类文件
 * 作者：刘单风
 * 最后修改时间：2018-11-24
 * 版权：医库PHP小组
 */

namespace app\model;
use app\model\modelbase\IBasemodel;
use think\Model;
use think\Db;

class Lucksponsor extends Model implements IBasemodel
{
    function Lucksponsor()
    {
        return [
            'id' => 0,
            'sp_name' => "",
            'sp_img' => "",
            'jump_url' => "",
            'sp_contact' => "",
            'jump_type' => -1,
            'sp_info' => "",
            'audit_status' => 1
        ];
    }
    function dataList($where="")
    {
        if ($where) {
            $data = Db::table('luck_sponsors')
                ->where($where)
                ->select();
        } else {
            $data = Db::table('luck_sponsors')
                ->select();
        }
        return $data;
    }

    function addOne($data)
    {
        $id = Db::table('luck_sponsors')
            ->insertGetId($data);
        return $id;
    }

    function updateOne($data, $where)
    {
        Db::table('luck_sponsors')
            ->where($where)
            ->update($data);
    }

    function oneDetail($where)
    {
        $data = Db::table('luck_sponsors')
            ->where($where)
            ->find();
        return $data;
    }

    function deleteOne($where)
    {
        // TODO: Implement deleteOne() method.
    }

}